const {ccclass, property} = cc._decorator;

@ccclass
export default class NewClass extends cc.Component {
   
    // LIFE-CYCLE CALLBACKS:
    _btn_world = false;
    _btn_friend = false;
    world_node = null;
    friend_node = null;
    onLoad () {
        this.world_node = this.node.getChildByName('world_node');
        this.friend_node = this.node.getChildByName('friend_node');
    }

    start () {

    }

    btn_close(){
        this.node.active = false;
    }

    btn_world(){
        if(this._btn_world == true)
        {
            return;
        }
        this._btn_world = true;
        this.world_node.getChildByName('choice').active = true;
        this.world_node.getChildByName('unchoice').active = false;
        this.friend_node.getChildByName('choice').active = false;
        this.friend_node.getChildByName('unchoice').active = true;
        this.node.getChildByName('world_rank').active = true;
        this.node.getChildByName('friend_rank').active = false;

        this._btn_world = false;
    }

    btn_friend(){
        if(this._btn_friend == true)
        {
            return;
        }
        this._btn_friend = true;
        this.world_node.getChildByName('choice').active = false;
        this.world_node.getChildByName('unchoice').active = true;
        this.friend_node.getChildByName('choice').active = true;
        this.friend_node.getChildByName('unchoice').active = false;
        this.node.getChildByName('world_rank').active = false;
        this.node.getChildByName('friend_rank').active = true;

        this._btn_friend = false;
    }

    // update (dt) {}
}
